import java.io.*;
import java.util.*;
public class Directory {

    private String current_dir;

    public Directory(String base_dir) {
	this.current_dir = base_dir;
    }

    public Vector getSubDirectories() {
	Vector vds = new Vector();
	if(current_dir == null) {
	    return vds;
	}

	File f = new File(current_dir);
	if(!f.isDirectory()) {
	    return vds;
	}

	vds.add(f.getPath());
	
	File tf1       = null;
	File tf2       = null;
	String flist[] = null;

	Enumeration enums = vds.elements();
	while(enums.hasMoreElements()) {
	    tf1 = new File((String)enums.nextElement());
	    flist = tf1.list();
	    for(int n=0; n<flist.length; n++) {
		tf2 = new File(tf1.getPath(), flist[n]);
		if(tf2.isDirectory()) {
		    vds.add(tf2.getPath());
		}
	    }
	}
	return vds;
    }

}
